<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ProColumn extends Model
{
    public $timestamps = false;
    protected $connection = 'xz';
    protected $table = 'pro_column';
    use HasFactory;

    public function children()
    {
        return $this->hasMany('App\Models\ProColumn','parent_id','id');
    }

    public function org()
    {
        return $this->hasOne('App\Models\Enterprise','id','eid')->select('id','name','full_name','tell');
    }

    public function courses()
    {
        return $this->belongsToMany('App\Models\ProColumn','course_class','course_id','class_id');
    }

}
